package com.ies.dx.dex.file;

import java.util.Vector;

import com.ies.dx.util.Input;

public class class_data_item extends dex_item
{
    private int static_fields_size; //uleb128 
    private int instance_fields_size; //uleb128 
    private int direct_methods_size; // uleb128 
    private int virtual_methods_size; // uleb128 
    private Vector static_fields = new Vector(); //encoded_field  
    private Vector instance_fields = new Vector(); //encoded_field   
    private Vector direct_methods = new Vector(); //encoded_method 
    private Vector virtual_methods = new Vector(); //encoded_method
    
    public class_data_item(dex_file file)
    {
        super(file);    
    }
    
    public void read(Input dis)
    {
        try
        {
            static_fields_size = dis.readULeb128();
            instance_fields_size = dis.readULeb128();
            direct_methods_size = dis.readULeb128();
            virtual_methods_size = dis.readULeb128();
            for (int i = 0; i < static_fields_size; i ++)
            {
                encoded_field ef = new encoded_field(mFile);
                ef.read(dis);
                static_fields.add(ef);
            }
            for (int i = 0; i < instance_fields_size; i ++)
            {
                encoded_field ef = new encoded_field(mFile);
                ef.read(dis);
                instance_fields.add(ef);
            }
            for (int i = 0; i < direct_methods_size; i ++)
            {
                encoded_method em = new encoded_method(mFile);
                em.read(dis);
                direct_methods.add(em);
            }
            for (int i = 0; i < virtual_methods_size; i ++)
            {
                encoded_method em = new encoded_method(mFile);
                em.read(dis);
                virtual_methods.add(em);
            }


        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        
    }

    public void readData(Input dis)
    {

        
    }

    public void show()
    {

        
    }

    public String getData()
    {

        return null;
    }
}
